package Java基础.String相关;

import org.junit.jupiter.api.Test;

/**
 * Created by didi on 03/01/2018.
 */
public class TestString {
    @Test
    public void Test1(){
        String str1 = "hello";
        String str2 = "he" + new String("llo");
        System.err.println(str1 == str2);
    }

    @Test
    public void Test2(){
        String str1 = "hello";
        String str2  = ("he" + new String("llo")).intern();
        System.err.println(str1 == str2);
    }

}
